package com.smmisia.shop.exception;

import com.smmisia.common.exception.ErrorCode;

/**
 * @author smmis
 */

public enum ProductErrorCode implements ErrorCode {

    /**
     * 商品相关错误
     */
    PRODUCT_SAVE_FAILED("PRODUCT_SAVE_FAILED", "商品信息保存失败"),

    PRODUCT_UPDATE_FAILED("PRODUCT_UPDATE_FAILED", "商品信息更新失败"),
    /**
     * 用户相关错误
     */
    COLLECTION_USER_QUERY_FAIL("COLLECTION_USER_QUERY_FAIL", "查询用户信息失败"),
    /**
     * 藏品持有相关错误
     */
    HELD_COLLECTION_SAVE_FAILED("HELD_COLLECTION_SAVE_FAILED", "藏品持有信息保存失败"),
    /**
     * 藏品相关错误
     */
    PRODUCT_QUERY_FAIL("PRODUCT_QUERY_FAIL", "查询商品信息失败"),
    /**
     * 藏品持有相关错误
     */
    HELD_COLLECTION_QUERY_FAIL("HELD_COLLECTION_QUERY_FAIL", "查询持有藏品信息失败"),
    /**
     * 藏品库存相关错误
     */
    PRODUCT_INVENTORY_UPDATE_FAILED("PRODUCT_INVENTORY_UPDATE_FAILED", "商品库存更新失败"),
    /**
     * 藏品流水信息保存失败
     */
    PRODUCT_STREAM_SAVE_FAILED("PRODUCT_STREAM_SAVE_FAILED", "商品流水信息保存失败"),
    /**
     * 藏品快照信息保存失败
     */
    COLLECTION_SNAPSHOT_SAVE_FAILED("COLLECTION_SNAPSHOT_SAVE_FAILED", "藏品快照信息保存失败"),
    /**
     * 商品流水信息已存在
     */
    PRODUCT_STREAM_EXIST("PRODUCT_STREAM_EXIST", "商品流水信息已存在，请不要重复提交"),

    CATEGORY_DOES_NOT_FOUND("CATEGORY_DOES_NOT_FOUND", "商品分类不存在");

    private String code;

    private String message;

    @Override
    public String getCode() {
        return this.code;
    }

    @Override
    public String getMessage() {
        return this.message;
    }

    ProductErrorCode(String code, String message) {
        this.code = code;
        this.message = message;
    }
}
